28. Exercise: Implement Delete

Delete

Code Delete

Complete the delete() method.

Exercise Code

Exercise: T09.06-Exercise-Delete

Provider Code

To complete the delete method, follow the steps below. (Hint: Use selections and args to identify a single item)

SOLUTION:
  • Get access to the underlying database and write URI matching code
  • Write code to delete a single row of data
  • Notify the ContentResolver of any change
  • Return the number of deletions